package com.lagou.dao.impl;

import com.lagou.dao.ArticleDao;
import com.lagou.domain.Article;
import org.springframework.jdbc.core.JdbcTemplate;

public class ArticleDaoImpl implements ArticleDao {

    private JdbcTemplate jdbcTemplate;

    public void add(Article article) {
        String sql = "insert into t_article values (null, ?, ?)";
        jdbcTemplate.update(sql, article.getTitle(), article.getContent());
    }

    public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate=jdbcTemplate;
    }
}
